<?php
namespace Mageplaza\HelloWorld\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Sayhello extends Command
{
    protected  $attributeResource;
    protected  $helperData;
    public function __construct(
        \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource,
        \Mageplaza\HelloWorld\Helper\Data $helperData
    )
    {
        $this->attributeResource = $attributeResource;
        $this->helperData= $helperData;
        parent::__construct();
    }

    protected function configure()
    {
        $this->setName('example:sayhello');
        $this->setDescription('Demo command line 添加命令行任务');
        parent::configure();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $k = $this->helperData->getInsertData(['name'=>"4444"]);
        $output->isDebug();
        $output->writeln("Hello World".$k);
    }
}